package com.example.smartplay.mapper;

import com.example.smartplay.entity.Apply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 
 * @since 2024-07-11
 */
@Mapper
public interface ApplyMapper extends BaseMapper<Apply> {

    //根据学生id和社团id查询申请
    @Select("select * from apply where student_id = #{studentId} and club_id = #{clubId} and (status = '待审核' )")
    List<Apply> selectByStatus(@Param("studentId") Integer studentId , @Param("clubId") Integer clubId);

    @Select("select count(*) from apply")
    Integer countapplys();

    List<Apply> selectapplyWithName(String status, Integer pageNum, Integer pageSize);
}
